﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using DotNet.Business;

public partial class index : System.Web.UI.Page
{
    #region 变量
    Tab_NewsBll tab_NewsBll = new Tab_NewsBll();
    Tab_CaseBll tab_CaseBll = new Tab_CaseBll();
    Tab_RawMaterialBll tab_RawMaterialBll = new Tab_RawMaterialBll();
    /// <summary>
    /// 公司新闻类别ID
    /// </summary>
    int _newsClassID = 2;
    /// <summary>
    /// 分页索引
    /// </summary>
    int _pageIndex = 1;
    /// <summary>
    /// 页数
    /// </summary>
    int _pageSize = 10;
    #endregion

    #region 加载页面
    protected void Page_Load(object sender, EventArgs e)
    {
        
        //绑定公司新闻
        this.bindNews();
        //绑定方案
        this.bindCase();
        //绑定材料
        this.bindRawMaterials();
       
    }
    #endregion

    #region 绑定新闻
    /// <summary>
    /// 绑定新闻
    /// </summary>
    private void bindNews() 
    {
        this.rep_News.DataSource = this.tab_NewsBll.pageForNews(this._pageIndex, 8, this._newsClassID);
        this.rep_News.DataBind();
    }
    #endregion

    #region 绑定方案
    /// <summary>
    /// 绑定方案
    /// </summary>
    private void bindCase() 
    {
        this.Rep_Case.DataSource = this.tab_CaseBll.pageForCase(1, 8, 0);
        this.Rep_Case.DataBind();
    }
    #endregion

    #region 绑定材料
    /// <summary>
    /// 绑定材料
    /// </summary>
    private void bindRawMaterials() 
    {
        this.Rep_RawMaterials.DataSource = this.tab_RawMaterialBll.pageForRawMaterial(1, 10, 0);
        this.Rep_RawMaterials.DataBind();
    }
    #endregion
}
